package com.xxxx.server.base;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxxx.server.mapper.EmployeeMapper;
import com.xxxx.server.pojo.Employee;

import javax.annotation.Resource;
import java.util.List;

public class BaseService {

    @Resource
    private EmployeeMapper employeeMapper;


    public List<Employee> queryEmpPage(Integer num, Integer size,QueryWrapper<Employee> queryWrapper){

        IPage<Employee> employeeIPage=new Page<>(num,size);
//        employeeMapper.selectPage(employeeIPage,employeeList);

        employeeIPage=employeeMapper.selectPage(employeeIPage,queryWrapper);

        List<Employee> list = employeeIPage.getRecords();

        return list;
    }

}
